<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/20
 * Time: 16:44
 */

namespace app\common\entity;


use think\Model;
use think\Request;

class WriteLog extends Model
{
    protected $table = 'write_log';

    public function addLog($user_name,$remark )
    {
        $entity = new self();

        $entity->remark = $remark;
        $entity->user_name = $user_name;
        $entity->create_time = time();
        $entity->ip = (new Request())->ip();

        return $entity->save();
    }
}